#!/usr/bin/python

import WykopAPI
import SimpleRequest
import WykopRespMywykop

class WykopMywykop(SimpleRequest.SimpleRequest):

    H_WykopAPI = None
	
    def _sng_query(self, type, Page =None):
        
        self._addElement('mywykop')
        self._addElement(type)
        if Page != None:
            self._addElement('page',str(Page))
        self._addAPIElement(self.H_WykopAPI._appkey, self.H_WykopAPI._userkey)
        self._send()
        C = WykopRespMywykop.WykopRespMywykop()
        return C._normalizeData(self._getData())
		
    def __init__(self, WykopAPIHandler):
        
        self.H_WykopAPI =  WykopAPIHandler
		
    def getIndex(self, Page =None):
	
	    return self._sng_query('index', Page)
		
    def getObserving(self, Page =None):

        return self._sng_query('observing', Page)
		
    def getMine(self, Page =None):

        return self._sng_query('mine', Page)
		
    def getComments(self, Page =None):
        
        return self._sng_query('received', Page)
